package com.lengxf.design;

public class Client {

    public static void main(String[] args) {
//        ConcreteMediator concreteMediator = new ConcreteMediator();
        SubConcreteMediator concreteMediator = new SubConcreteMediator();
        Button button = new Button();
        List list = new List();
        ComboBox comboBox = new ComboBox();
        TextBox textBox = new TextBox();
        Label label = new Label();

        button.setMediator(concreteMediator);
        list.setMediator(concreteMediator);
        comboBox.setMediator(concreteMediator);
        textBox.setMediator(concreteMediator);
        label.setMediator(concreteMediator);

        concreteMediator.addButton = button;
        concreteMediator.list = list;
        concreteMediator.comboBox = comboBox;
        concreteMediator.textBox = textBox;
        concreteMediator.label = label;

        button.changed();
        System.out.println("--------------------");
        list.changed();
    }

}
